load("@batfish//skylark:junit.bzl", "junit_tests")
load("@batfish//skylark:pmd_test.bzl", "pmd_test")
load("@rules_java//java:defs.bzl", "java_library")

package(
    default_testonly = True,
    default_visibility = ["//visibility:public"],
)

java_library(
    name = "client_testlib",
    testonly = True,
    srcs = glob(
        ["**/*.java"],
        exclude = ["**/*Test.java"],
    ),
    deps = [
        "//projects/batfish-common-protocol:common",
        "@maven//:com_fasterxml_jackson_core_jackson_annotations",
        "@maven//:com_google_guava_guava",
    ],
)

pmd_test(
    name = "client_testlib_pmd",
    lib = ":client_testlib",
)

junit_tests(
    name = "client_tests",
    size = "small",
    srcs = glob(["**/*Test.java"]),
    resources = ["//projects/client/src/test/resources/org/batfish/client"],
    deps = [
        ":client_testlib",
        "//projects/batfish-common-protocol:common",
        "//projects/client",
        "@maven//:com_fasterxml_jackson_core_jackson_databind",
        "@maven//:com_google_guava_guava",
        "@maven//:io_github_java_diff_utils_java_diff_utils",
        "@maven//:junit_junit",
        "@maven//:org_apache_commons_commons_lang3",
        "@maven//:org_codehaus_jettison_jettison",
        "@maven//:org_hamcrest_hamcrest",
    ],
)
